<?php

namespace App\Models;



class Star extends Base
{
    const TYPE_ARTICLE = 1;
    const TYPE_COMMENT = 2;

    protected $fillable = ['user_id', 'entity_id', 'type', 'entity_user_id', 'article_id', 'article_user_id', 'child_type'];

    public function user() {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function article() {
        return $this->belongsTo(Article::class, 'article_id');
    }

    public function article_user() {
        return $this->belongsTo(User::class, 'article_user_id');
    }
}
